﻿using ConsoleApp.Infrastructure.Attributes;
using ConsoleApp.Infrastructure.TaskFramework;
using ConsoleApp.Service;
using ConsoleApp.Util;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;

namespace ConsoleApp.Job.TaskJob
{
    [TaskInterceptor("数据库查询任务", TaskLevel.One)]
    public class 数据库查询任务 : TaskBase
    {
        private static List<Order> orders = new List<Order>();
        private static ILogger _logger;
        public override void Execute()
        {
            DistinctService distinctService = new DistinctService();
            var distinctList = distinctService.GetList();

            foreach (var distinct in distinctList)
            {
                $"{distinct.Name}".WriteInfoLine();
            }
            ConsoleHelper.WriteInfoLine("数据初始化完成");
            //for (int i = 0; i < 9000000; i++)
            //{
            //    orders.Add(new Order() { Oid = Guid.NewGuid().ToString(), OName = "OrderName_" + i.ToString() });
            //}
            //ConsoleHelper.WriteInfoLine("数据初始化完成");
            ////SendMsgByFeiShu("飞书通知",false);
            //Operation();

            //TaskOperation();
        }
    }

    public class Order
    {
        public string Oid { get; set; }
        public string OName { get; set; }
        public bool IsSubmit { get; set; }
    }
}
